package com.components.cachewebview

import com.tencent.smtt.export.external.interfaces.WebResourceRequest
import com.tencent.smtt.export.external.interfaces.WebResourceResponse
import com.tencent.smtt.sdk.WebView
import java.io.File
import java.io.InputStream

interface WebViewRequestInterceptor {

    fun interceptRequest(request: WebResourceRequest?): WebResourceResponse?
    fun interceptRequest(url: String): WebResourceResponse?
    fun getCachePath(): File?

    fun clearCache()
    fun enableForce(force: Boolean)
    fun getCacheFile(url: String): InputStream?
    fun initAssetsData()
    fun loadUrl(webView: WebView?, url: String)
    fun loadUrl(url: String, userAgent: String)
    fun loadUrl(url: String, additionalHttpHeaders: Map<String?, String?>?, userAgent: String)
    fun loadUrl(webView: WebView?, url: String, additionalHttpHeaders: Map<String, String>)

}